//
//  T3FMapLocation.swift
//  t3_map
//
//  Created by Cunhai Li on 2024/10/31.
//

import Foundation
import CoreLocation

struct T3FMapLocation {

    let provider: String

    ///经纬度
    let coordinate: CLLocationCoordinate2D

    ///水平精确度
    let accuracy: Double

    ///海拔
    let altitude: Double

    ///角度
    let bearing: Double

    ///速度
    let speed: Double

    ///定位时间
    let time: TimeInterval
}

extension T3FMapLocation {
    func toJson() -> [String: Any] {
        return [
            "provider": provider,
            "longitude": coordinate.longitude,
            "latitude": coordinate.latitude,
            "accuracy": accuracy,
            "altitude": altitude,
            "bearing": bearing,
            "speed": speed,
            "time": time
        ];
    }
}
